/* styles.css */

/* IMPORTAR FUENTES DE GOOGLE FONTS */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Open+Sans:wght@400;600&display=swap');

/* Paleta corporativa: verde, blanco, gris, negro */
:root {
    --verde: #0f9d58;
    --verde-oscuro: #0b7a43;
    /* Nuevo color para hover */
    --gris-claro: #f8f9fa;
    /* Más limpio, menos grisáceo */
    --gris-oscuro: #333333;
    /* Suvizado ligeramente */
    --blanco: #ffffff;
    --sombra-suave: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --sombra-fuerte: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
}

body {
    margin: 0;
    font-family: 'Open Sans', Arial, sans-serif;
    /* Tipografía moderna */
    background-color: var(--gris-claro);
    color: var(--gris-oscuro);
    line-height: 1.6;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

p {
    text-align: justify;
}


/* HEADER */
.header {
    background-color: rgba(255, 255, 255, 0.95);
    /* Semi-transparente */
    backdrop-filter: blur(10px);
    /* Efecto cristal */
    -webkit-backdrop-filter: blur(10px);
    color: var(--gris-oscuro);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    position: sticky;
    /* Sticky header */
    top: 0;
    z-index: 1000;
    /* Asegurar que esté encima de todo */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* Logo */
.header .logo img {
    width: 250px;
    height: auto;
}

/* Menú principal centrado en la página */
.header .menu-main {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header .menu-main ul {
    list-style: none;
    display: flex;
    gap: 20px;
    padding: 0;
    margin: 0;
    align-items: center;
}

.header .menu-main li:not(:last-child)::after {
    content: "|";
    margin-left: 20px;
    color: var(--gris-oscuro);
}

.header .menu-main a {
    text-decoration: none;
    color: var(--gris-oscuro);
    font-weight: 600;
    /* Semi-bold */
    font-size: 1.1rem;
    /* Ajustado para Montserrat/Open Sans */
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    position: relative;
}

.header .menu-main a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--verde);
    transition: width 0.3s ease;
}

.header .menu-main a:hover::after {
    width: 100%;
}

.header .menu-main a:hover {
    color: var(--verde);
}

/* Menú de LinkedIn a la derecha */
.header .menu-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header .menu-right a img {
    width: 30px;
    height: 30px;
    cursor: pointer;
}



/* CARRUSEL */
.carrusel {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    /* allow width to control height automatically */
    max-height: 80vh;
    overflow: hidden;
    background-color: var(--blanco);
    /* fondo claro en vez de negro */
}


.carrusel .slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.carrusel .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease, transform 0.5s ease;
}

.carrusel .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* cubre todo el contenedor, recortando si es necesario */
}

.carrusel .slide.active {
    opacity: 1;
}

.carrusel .slide:first-child.active {
    /* no offset to avoid shifting first image */
    transform: none;
}

/* Carrusel: texto centrado abajo */
.carrusel .slide-text {
    position: absolute;
    bottom: 10%;
    /* Deja un 10% de espacio desde abajo */
    left: 50%;
    transform: translateX(-50%);
    color: var(--blanco);
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    /* Más grande e impactante */
    font-weight: 700;
    text-align: center;
    text-shadow: -2px -2px 0 var(--gris-oscuro), 2px -2px 0 var(--gris-oscuro), -2px 2px 0 var(--gris-oscuro), 2px 2px 0 var(--gris-oscuro);
    padding: 0 20px;
    /* Espaciado lateral para texto largo */
    background-color: rgba(0, 0, 0, 0.2);
    /* Fondo semitransparente opcional */
    border-radius: 5px;
    opacity: 0;
    transform: translateY(20px) translateX(-50%);
    transition: all 1s ease;
}

/* Cuando el slide está activo, el texto aparece */
.carrusel .slide.active .slide-text {
    opacity: 1;
    transform: translateY(0) translateX(-50%);
}

.carrusel-controls {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    /* flex removed to allow manual positioning */
    padding: 0;
    box-sizing: border-box;
}

.carrusel-controls span {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 2em;
    color: var(--gris-oscuro);
    /* oscuro para resaltar sobre fondos claros */
    user-select: none;
}

.carrusel-controls span.prev {
    left: 5px;
}

.carrusel-controls span.next {
    right: 5px;
}

.carrusel-controls span {
    cursor: pointer;
    font-size: 2em;
    color: var(--blanco);
    user-select: none;
}

/* QUIÉNES SOMOS */
.quienes-somos {
    padding: 60px 50px;
}

.quienes-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
    padding: 0 20px;
    /* espacio lateral alrededor del contenido INCONEF */
    max-width: 1200px;
    margin: 0 auto;
}

.quienes-texto {
    order: 1;
}

.quienes-imagen {
    order: 2;
}

.quienes-imagen {
    flex: 1;
}

.quienes-imagen img {
    width: 100%;
    border-radius: 10px;
}

.quienes-texto {
    flex: 1;
}

.quienes-texto h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--verde);
    font-size: 2.8rem;
    margin-bottom: 20px;
}

.quienes-texto p {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.quienes-texto button {
    padding: 12px 25px;
    background-color: var(--verde);
    color: var(--blanco);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.quienes-texto button:hover {
    background-color: #0b7a43;
}

/* PROYECTOS */
.proyectos {
    padding: 30px 50px;
    /* Reduced padding */
    background-color: transparent;
}

.proyectos h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.proyectos-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    /* Más espacio */
    justify-content: center;
}

.proyecto {
    background-color: var(--blanco);
    border-radius: 15px;
    /* Bordes más suaves */
    overflow: hidden;
    width: 320px;
    box-shadow: var(--sombra-suave);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
    /* Borde sutil */
}

.proyecto img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.proyecto h3 {
    margin: 15px 0;
    font-size: 1.5rem;
}

.proyecto p {
    padding: 0 15px 15px;
    font-size: 1rem;
    color: var(--gris-oscuro);
    text-align: center;
}

.proyectos button {
    display: block;
    margin: 10px auto 0;
    padding: 10px 30px;
    background-color: transparent;
    /* No background */
    color: var(--verde);
    /* Green text */
    border: 2px solid var(--verde);
    /* Green border */
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}

.proyectos button:hover {
    background-color: var(--verde);
    color: var(--blanco);
}

/* CONTACTO */
.contacto {
    background-color: var(--verde);
    color: var(--blanco);
    padding: 50px 20px;
}

.contacto h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
}

/* Contenedor dos columnas */
.contacto-container {
    display: flex;
    gap: 40px;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* IZQUIERDA */
.contacto-info-mapa {
    flex: 1 1 48%;
}

.contacto-info h3 {
    margin-bottom: 5px;
}

.contacto-info p {
    margin-bottom: 15px;
    line-height: 1.4;
}

.contacto-info a {
    color: var(--blanco);
    text-decoration: underline;
}

.contacto-info-mapa iframe {
    width: 100%;
    height: 300px;
    border: 0;
    border-radius: 10px;
    margin-top: 10px;
}

/* DERECHA: FORMULARIO */
.contacto-form {
    flex: 1 1 48%;
}

.contacto-form p {
    font-weight: bold;
    margin-bottom: 20px;
}

.contacto-form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
}

.contacto-form input,
.contacto-form textarea {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: none;
    margin-bottom: 10px;
}

.contacto-form button {
    background-color: var(--gris-oscuro);
    color: var(--blanco);
    border: none;
    padding: 12px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 10px;
}

.contacto-form button:hover {
    background-color: #000;
}

/* CONTACTO - añadir márgenes laterales */
.contacto {
    background-color: var(--verde);
    color: var(--blanco);
    padding: 50px 20px;
    /* padding superior/inferior y lateral */
}

/* Para más espacio lateral en pantallas grandes */
.contacto-container {
    display: flex;
    gap: 40px;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1200px;
    /* ancho máximo */
    margin: 0 auto;
    /* centra el contenedor */
}


/* RESPONSIVE */
@media (max-width: 900px) {
    .contacto-container {
        flex-direction: column;
    }

    .contacto-info-mapa,
    .contacto-form {
        flex: 1 1 100%;
    }
}


/* FOOTER */
footer {
    background-color: var(--gris-oscuro);
    color: var(--gris-claro);
    text-align: center;
    padding: 20px 0;
}


/* Animaciones */
/* Animaciones globales */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* QUIÉNES SOMOS */
.quienes-texto,
.quienes-imagen {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 1s ease-out;
}

.quienes-texto.visible {
    opacity: 1;
    transform: translateX(0);
}

.quienes-imagen.visible {
    opacity: 1;
    transform: translateX(0);
}

/* PROYECTOS */
.proyecto {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.proyecto.visible {
    opacity: 1;
    transform: translateY(0);
}

/* CONTACTO */
.contacto-info,
.contacto-form {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease-out;
}

.contacto-info.visible,
.contacto-form.visible {
    opacity: 1;
    transform: translateY(0);
}

/* BOTONES: hover con efecto de escala */
.quienes-texto button,
.proyectos button,
.contacto-form button {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quienes-texto button:hover,
.proyectos button:hover,
.contacto-form button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* FADE-IN general para elementos textuales */
h2,
h3,
p {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out;
}

h2.visible,
h3.visible,
p.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ANIMACIÓN INTERACTIVA AL PASAR EL RATÓN SOBRE LOS PROYECTOS */
.proyecto {
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

/* Efecto de elevación y brillo al hacer hover */
.proyecto:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

/* Oscurece ligeramente la imagen y muestra overlay */
.proyecto::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.4s ease;
    z-index: 1;
}

.proyecto:hover::before {
    background: rgba(0, 0, 0, 0.2);
}

/* Imagen con efecto de zoom suave */
.proyecto img {
    transition: transform 0.5s ease;
}

.proyecto:hover img {
    transform: scale(1.1);
}

/* Texto del proyecto encima de la imagen con animación */
.proyecto h3,
.proyecto p {
    position: relative;
    z-index: 2;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.proyecto:hover h3 {
    transform: translateY(-5px);
    color: var(--verde);
}

.proyecto:hover p {
    transform: translateY(-3px);
    opacity: 0.95;
}




/* PÁGINA DE PROYECTOS */
.proyectos-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px;
    background-color: var(--gris-claro);
    text-align: center;
}

.proyectos-page h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 3rem;
    color: var(--verde);
    margin-bottom: 10px;
}

.proyectos-page .intro {
    max-width: 800px;
    margin: 0 auto 50px;
    font-size: 1.2rem;
    color: var(--gris-oscuro);
}

/* GRID PARA SERVICIOS (4 COLUMNAS EN UNA FILA) */
.servicios-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-width: 1400px;
    /* Increased to fit 4 cards of 350px */
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* GRID PARA PROYECTOS (CENTRADO) */
.proyectos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
}

/* New specific class for centering items when they don't fill a full row */
.proyectos-grid-center {
    display: flex;
    flex-wrap: nowrap;
    /* Force one line on desktop */
    justify-content: center;
    gap: 30px;
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
    overflow-x: auto;
    /* Safety for very narrow viewports */
}

.proyectos-grid-center .proyecto-card {
    flex: 0 1 350px;
    /* flex-shrink: 1 allows them to shrink to fit one line */
    width: 350px;
}

/* Allow wrapping on mobile/tablet */
@media (max-width: 900px) {
    .proyectos-grid-center {
        flex-wrap: wrap;
    }
}

.proyectos-grid a,
.proyectos-grid-center a {
    text-decoration: none !important;
    color: inherit;
}

.proyecto-card {
    background-color: var(--blanco);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--sombra-suave);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
}

.proyecto-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-fuerte);
}

.img-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: #fff;
}

.img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.proyecto-card:hover .img-container img {
    transform: scale(1.05);
}

.proyecto-info {
    padding: 20px;
}

.proyecto-info h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    color: var(--verde);
    margin-bottom: 15px;
}

.proyecto-info p {
    color: var(--gris-oscuro);
    font-size: 1rem;
    line-height: 1.5;
    text-align: left;
}

/* Botón volver */
.volver {
    margin-top: 50px;
}

.volver button {
    padding: 12px 25px;
    background-color: var(--verde);
    color: var(--blanco);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.volver button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Estado activo en el menú */
.menu-main a.activo {
    color: var(--verde);
    border-bottom: 2px solid var(--verde);
}

/* ==========================================
   🔹 FIX RESPONSIVE: DETALLE PROYECTO
   (Sobrescribe los estilos inline de las páginas de proyecto)
   ========================================== */
@media (max-width: 900px) {
    body .detalle-proyecto {
        flex-direction: column !important;
        padding: 30px 20px !important;
        gap: 30px !important;
        width: 90% !important;
        box-sizing: border-box;
    }

    body .detalle-proyecto img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 !important;
    }

    body .proyecto-descripcion {
        width: 100% !important;
        text-align: left !important;
        /* Mejor lectura en móvil */
    }

    body .proyecto-descripcion h1 {
        font-size: 1.8rem !important;
        text-align: center;
    }
}



/* PÁGINA DE PROYECTOS - AJUSTES DE VISIBILIDAD Y CONTRASTE */
/* Estilos de texto en las tarjetas de proyectos */
/* Texto siempre visible sobre la imagen */
.proyecto h3,
.proyecto p,
.proyecto-card h3,
.proyecto-card p {
    position: relative;
    z-index: 2;
    opacity: 1;
    /* Siempre visible */
    transform: translateY(0);
    /* Sin desplazamiento */
    transition: none;
    /* Eliminamos transición de hover para visibilidad */
}

/* Puedes mantener el efecto hover solo de color y elevación */
.proyecto:hover h3,
.proyecto-card:hover h3 {
    color: var(--verde);
}

.proyecto:hover p,
.proyecto-card:hover p {
    /* Opcional: puedes dejar solo el color y no la opacidad */
    color: var(--gris-oscuro);
}


/* ==========================================
   🔹 AJUSTES RESPONSIVE GLOBALES
   ========================================== */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {

    /* QUIÉNES SOMOS: apilar verticalmente en tablets y móviles grandes */
    .quienes-container {
        flex-direction: column !important;
    }

    .quienes-texto {
        order: 1 !important;
    }

    .quienes-imagen {
        order: 2 !important;
    }

    /* HEADER */
    .header {
        flex-direction: column;
        align-items: center;
        padding: 15px 25px;
    }

    .header .logo img {
        width: 180px;
        margin-bottom: 10px;
    }

    .header .menu-main {
        position: static;
        transform: none;
        margin-top: 10px;
    }

    .header .menu-main ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .header .menu-main li:not(:last-child)::after {
        display: none;
    }

    /* GRID DE PROYECTOS */
    .proyectos-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
        padding: 0 20px;
    }

    .proyecto-card img {
        height: 180px;
    }

    .proyectos-page h1 {
        font-size: 2.3rem;
    }

    .proyectos-page .intro {
        font-size: 1.1rem;
        padding: 0 10px;
    }

    /* BOTÓN VOLVER */
    .volver button {
        font-size: 1rem;
    }
}


/* Para pantallas grandes */
@media (min-width: 1025px) {
    .proyectos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}



/* Pantallas muy grandes (>1600px) */
@media (min-width: 1600px) {
    html {
        font-size: 110%;
    }

    .proyectos-page h1 {
        font-size: 3.2rem;
    }

    .proyecto-card img {
        height: 260px;
    }

    .proyectos-grid {
        gap: 50px;
    }
}

/* hamburguesa para menú móvil */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

.hamburger div,
.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--gris-oscuro);
    transition: all 0.3s ease;
}

/* Mostrar menú oculto en móvil cuando se abre */
.menu-main.open {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 10px 0;
}

/* Asegura que todas las tarjetas de servicios tengan la misma altura */
.proyectos-container2 {
    display: flex;
    flex-wrap: wrap;
    gap: 60px;
    justify-content: center;
    align-items: stretch;
    /* Hace que todas las tarjetas tengan la misma altura */
}

.proyecto-card2 {
    background-color: var(--blanco);
    border-radius: 10px;
    overflow: hidden;
    width: 300px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.proyecto-info2 {
    padding: 40px;
    flex: 1;
    /* Hace que el contenido ocupe todo el espacio y fuerza altura uniforme */
}

/* Justificar textos en servicios */
.proyecto-info3 p {
    /* Justificar textos en servicios y dejar márgenes laterales */
    padding: 0 15px;
    /* 15px de espacio a los lados */
    box-sizing: border-box;
    /* Para que el padding no rompa el ancho de la tarjeta */

    color: var(--gris-oscuro);
    font-size: 1rem;
    line-height: 1.5;
}

.proyecto-info h3 {
    text-align: center;
    /* Encabezado centrado, opcional */
}


.proyectos-page .proyectos-grid {
    max-width: 100%;
    margin: 0 auto;
    gap: 30px;
}

.proyectos-page .proyecto-card {
    box-sizing: border-box;
    width: 100%;
    /* Ensure it fills the grid cell */
}

.proyecto-info3 {
    padding: 20px;
    max-width: 480px;
    margin: 0 auto;
}

.proyectos-grid a,
.proyectos-grid-center a,
.servicios-grid a {
    text-decoration: none !important;
    /* elimina subrayado */
    color: inherit;
    /* mantiene el color del texto dentro */
    display: block;
    /* para que todo el div sea clicable correctamente */
}

.proyectos-page .proyectos-grid a,
.proyectos-page .proyectos-grid-center a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.proyectos-page .intro,
.proyectos-page .proyecto-info3 {
    opacity: 1 !important;
    transform: none !important;
    max-width: 900px;
    margin: 0 auto 20px;
}

/* Asegúrate de que tenga alta especificidad */
.proyectos-page h2 {
    font-size: 2.5rem;
    /* Tamaño destacado */
    color: #0f9d58;
    /* Color verde corporativo */
    text-align: center;
    /* Centrado */
    margin: 20px auto 40px;
    /* Separación arriba y abajo */
    max-width: 900px;
    /* Limitar ancho */
    font-weight: 600;
    /* Semi-negrita */
    line-height: 1.4;
    /* Mejor lectura */
    display: block;
    /* Asegura que sea visible */
}

.proyectos-page h3 {
    font-size: 2rem;
    color: var(--gris-oscuro);
    margin: 30px 0 10px;
    max-width: 900px;

    text-align: center;
    /* Centrado */
    margin: 20px auto 40px;
    /* Separación arriba y abajo */
    max-width: 900px;
    /* Limitar ancho */
    font-weight: 600;
    /* Semi-negrita */
    line-height: 1.4;
    /* Mejor lectura */
    display: block;
    /* Asegura que sea visible */
}

.proyectos-page .intro {
    max-width: 900px;
    margin: 0 auto 20px;
    color: var(--gris-oscuro);
    line-height: 1.6;
}

/* Estilo para h4 */
.proyectos-page h4 {
    font-size: 1.5rem;
    color: var(--gris-oscuro);
    margin: 30px 0 10px;
    max-width: 900px;

    text-align: center;
    /* Centrado */
    margin: 20px auto 40px;
    /* Separación arriba y abajo */
    max-width: 900px;
    /* Limitar ancho */
    font-weight: 600;
    /* Semi-negrita */
    line-height: 1.4;
    /* Mejor lectura */
    display: block;
}












/* QUIÉNES SOMOS */
.quienes-somos {
    padding: 60px 50px;
}

.quienes-container {
    display: flex;
    align-items: center;
    gap: 40px;
}

.quienes-imagen {
    flex: 1;
}

.quienes-imagen img {
    width: 100%;
    border-radius: 10px;
}

.quienes-texto {
    flex: 1;
}

.quienes-texto h2 {
    font-size: 2.8rem;
    margin-bottom: 20px;
}

.quienes-texto p {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.quienes-texto button {
    padding: 12px 25px;
    background-color: var(--verde);
    color: var(--blanco);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.quienes-texto button:hover {
    background-color: #0b7a43;
}

/* =====================
   FOOTER SIN ANIMACIONES
===================== */
footer {
    background-color: var(--gris-oscuro);
    color: var(--gris-claro);
    text-align: center;
    padding: 20px 0;
}



.cookies-container {
    max-width: 1000px;
    margin: 80px auto;
    padding: 0 30px;
}

.cookies-container h1 {
    color: #1b9c5a;
    font-size: 28px;
    margin-bottom: 40px;
}

.cookies-container h2 {
    margin-top: 40px;
    font-size: 18px;
}

.cookies-container p {
    line-height: 1.7;
    font-size: 15px;
    color: #555;
}

/* ====== PÁGINAS LEGALES (cookies, aviso legal, privacidad) ====== */
.cookies-container h1,
.cookies-container h2,
.cookies-container p {
    opacity: 1 !important;
    transform: none !important;
}

main {
    flex: 1;
}

/* ===== FIX PÁGINAS LEGALES ===== */
.cookies-container {
    opacity: 1 !important;
}

.cookies-container h1,
.cookies-container h2,
.cookies-container p {
    opacity: 1 !important;
    transform: none !important;
    display: block !important;
}

.cookies-container {
    min-height: calc(100vh - 220px);
    /* header + footer */
}

/* ==========================================
   🔹 CORRECCIÓN DEL FOOTER - DISEÑO ROBUSTO Y FLEXIBLE
   ========================================== */

footer,
.footer,
.footer *,
footer * {
    background-color: #222 !important;
    color: #f5f5f5 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

footer,
.footer {
    padding: 60px 0 30px !important;
    text-align: center !important;
    position: relative !important;
    display: block !important;
    width: 100% !important;
    clear: both !important;
}

.footer-container {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px 40px 0 40px !important;
    gap: 40px !important;
    opacity: 1 !important;
}

.footer-logo,
.footer-center,
.footer-right {
    flex: 1 00px !important;
    margin-bottom: 20px !important;
}

.footer-logo img {
    max-width: 320px !important;
    /* Reducido un poco para mejor balance */
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
}

.footer-center p {
    margin: 0 0 10px 0 !important;
    line-height: 1.5 !important;
    text-align: center !important;
    color: #f5f5f5 !important;
}

.footer-right {
    text-align: center !important;
    align-items: center !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    flex: 1 !important;
}

.footer-right p {
    margin: 0 0 5px 0 !important;
    line-height: 1.5 !important;
    text-align: center !important;
    width: 100% !important;
}

.footer-logos {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 0px !important;
}

.footer-logos img {
    height: 60px !important;
    /* Logo UE/LEADER ajustado a 60px */
    width: auto !important;
    margin: 0 15px !important;
}

.footer-bottom {
    margin-top: 50px !important;
    font-size: 14px !important;
    color: #bbb !important;
    text-align: center !important;
    width: 100% !important;
    padding-top: 25px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.footer a {
    color: #fff !important;
    text-decoration: underline !important;
    font-weight: 500 !important;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .footer-container {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    .footer-logo,
    .footer-center,
    .footer-right {
        text-align: center !important;
        align-items: center !important;
    }

    .footer-right {
        text-align: center !important;
        display: flex !important;
        gap: 20px !important;
    }

    .quienes-imagen,
    .quienes-texto {
        width: 100% !important;
        flex: none !important;
    }

    .quienes-imagen {
        order: 1 !important;
        /* Imagen arriba */
    }

    .quienes-texto {
        order: 2 !important;
        /* Texto abajo */
        text-align: center !important;
    }

    .quienes-texto h2 {
        font-size: 2rem !important;
    }

    .quienes-texto p {
        font-size: 1.1rem !important;
        text-align: left !important;
    }

    /* Ajustes generales de espaciado */
    .quienes-somos {
        padding: 40px 15px !important;
    }
}

/* ==========================================
   🔹 FINAL MOBILE OVERRIDES (AL FINAL PARA PRIORIDAD) 
   ========================================== */
@media (max-width: 768px) {

    /* HTML & BODY */
    html {
        font-size: 90% !important;
    }

    /* HEADER: Compacto para móviles */
    .header {
        padding: 10px 15px !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        /* Permitir que los elementos salten de línea */
        justify-content: space-between !important;
        height: auto !important;
        align-items: center !important;
    }

    .header .logo img {
        width: 140px !important;
        height: auto !important;
    }

    .header .logo {
        order: 1 !important;
        width: auto !important;
    }

    .header .menu-right {
        order: 2 !important;
        width: auto !important;
    }

    .header .menu-main {
        order: 3 !important;
        position: relative !important;
        left: auto !important;
        transform: none !important;
        margin-top: 15px !important;
        width: 100% !important;
        display: block !important;
    }

    .header .menu-main ul {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px !important;
        padding: 0 !important;
    }

    .header .menu-main li:not(:last-child)::after {
        display: none !important;
    }

    .header .menu-main a {
        font-size: 0.7rem !important;
        padding: 3px !important;
        line-height: 1.4 !important;
    }

    /* en desplegado occupy full width for easier tapping */
    .menu-main.open ul li {
        width: 100%;
        text-align: center;
    }

    /* ocultar menú y mostrar hamburguesa por defecto en móvil */
    .hamburger {
        display: flex !important;
    }

    .menu-main {
        display: none !important;
    }

    .menu-main.open {
        display: flex !important;
    }

    /* CARRUSEL: usar ratio para que ancho y alto escalen juntos */
    .carrusel {
        height: auto !important;
        aspect-ratio: 16/9 !important;
        max-height: 60vh !important;
        background-color: transparent !important;
    }

    .carrusel .slide {
        background-size: contain !important;
        /* muestra toda la imagen sin cortarla */
        background-repeat: no-repeat !important;
        background-position: center center !important;
        background-color: transparent !important;
    }

    /* QUIÉNES SOMOS: texto arriba de la imagen */
    .quienes-container {
        flex-direction: column !important;
        display: flex !important;
        gap: 20px !important;
        padding: 0 !important;
    }

    .quienes-imagen,
    .quienes-texto {
        width: 100% !important;
        flex: none !important;
    }

    .quienes-imagen {
        order: 2 !important;
    }

    .quienes-texto {
        order: 1 !important;
        padding: 0 15px !important;
        text-align: left !important;
    }

    .quienes-texto h2 {
        font-size: 1.8rem !important;
        margin-top: 0 !important;
    }

    /* FIX GENERAL PARA PROYECTOS Y PÁGINAS QUE NO SE AJUSTAN */
    .proyectos-page,
    .proyectos,
    main,
    section {
        padding: 40px 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .proyectos-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 !important;
        margin: 0 auto !important;
        width: 100% !important;
    }

    .proyecto-card,
    .proyecto {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 20px 0 !important;
        box-sizing: border-box !important;
    }

    .img-container {
        height: auto !important;
        min-height: 150px !important;
    }

    .img-container img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Standard content fix */
    main,
    section,
    div {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}